<%@ taglib prefix="v-bind" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="../../static/common/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/css/global.css">
</head>
<body>
<div id="content">
    <div class="admin-main">
        <fieldset class="layui-elem-field">
            <legend>学生信息</legend>
            <div class="layui-field-box layui-form">
                <table class="layui-table admin-table">
                    <thead>
                    <tr>
                        <th>班级</th>
                        <th>学号</th>
                        <th>姓名</th>
                    </tr>
                    </thead>
                    <%--内容容器--%>
                    <tbody id="content1">
                    </tbody>
                </table>
            </div>
        </fieldset>

        <%--分页容器--%>
        <div class="admin-table-page">
            <div id="paged" class="page">
            </div>
        </div>
    </div>
</div>
</body>
<!--模板-->
<script type="text/html" id="tpl">
    {{# layui.each(d.data, function(index, item){ }}
    <tr>
        <td>{{ item.class.name || "-"}}</td>
        <td>{{ item.user.workid || "-" }}</td>
        <td>{{ item.user.realname || "-" }}</td>
    </tr>
    {{# }); }}
</script>
<script type="text/javascript">
    var userid = ${sessionScope.currentUser.getId()};
</script>
<script type="text/javascript" src="../../static/common/jquery-3.2.1.js"></script>
<script type="text/javascript" src="../../static/js/utils.js"></script>
<script type="text/javascript" src="../../static/common/layui/layui.js"></script>
<script type="text/javascript" src="../../static/common/vue.min.js"></script>
<script type="text/javascript" src="../../static/common/axios.min.js"></script>
<script>
    layui.config({
        base: '/static/js/layuiModulesEX/'
    });
    layui.use(['form','layer','jquery','laypage','layer','paging'],function () {
        var laypage = layui.laypage,
            layer = layui.layer,
            form = layui.form,
            paging = layui.paging();

//        laypage({
//            cont:'paged',
//            cont:'paged',
//            pages:100,
//            skip:true,
//            layout:['count','prev','page','next','limit','skip'],
//            jump:function (obj) {
//                console.log(obj);
//            }
//        });

        paging.init({
            openWait: true,
            url: '/student/findDetailBatchBySchoolId',
            elem: '#content1', //内容容器
            params: { //发送到服务端的参数
                userid: userid
            },
            contentType: "application/json; charset=utf-8",
            type: 'POST',
            tempElem: '#tpl', //模块容器
            pageConfig: { //分页参数配置
                elem: 'paged', //分页容器
                pageSize: 10 //分页大小
            },
            success: function (res) { //渲染成功的回调
                //alert('渲染成功');
            },
            fail: function (msg) { //获取数据失败的回调
                //alert('获取数据失败')
            },
            complate: function () { //完成的回调
                //alert('处理完成');
            }
        });

    })
</script>